<template>
  <div>
    <h1>分类列表</h1>
    <ul>
      <li v-for="category in categoryStore.categories" :key="category.id">
        {{ category.name }} - {{ category.description }}
      </li>
    </ul>
  </div>
</template>

<script lang="ts" setup>
import { onMounted } from 'vue';
import { useCategoryStore } from '@/stores/category';

const categoryStore = useCategoryStore();

onMounted(async () => {
  await categoryStore.fetchCategories();
});
</script> 